Release 10.1A: OpenEdge Development:
Programming Interfaces


Methods and attributes

To use the XML read and write features described in this chapter, you use the handle to a temp-table, temp-table buffer, or ProDataSet to access methods and attributes of the object. Table 22–1 describes the available methods.

Table 22–1: XML methods for temp-tables and ProDataSets
Method
Description
READ-XMLSCHEMA( ) 
Creates a dynamic temp-table or ProDataSet from the specified XML Schema. Or, it can verify an existing 4GL definition against the XML Schema.
READ-XML( ) 
Loads data into a static or dynamic temp-table or ProDataSet from the specified XML. Optionally, it can create the temp-table or ProDataSet definition or verify the definition against the specified XML Schema.
WRITE-XMLSCHEMA( ) 
Writes the schema of the specified static or dynamic temp-table or ProDataSet as XSD. Options allow you to control the formatting, encoding, and level of definition detail.
WRITE-XML( ) 
Writes the data and, optionally, the definition of the specified static or dynamic temp-table or ProDataSet as XML. Options allow you to control the formatting, encoding, and level of definition detail.

The XML related attributes are described in Table 22–2.

Table 22–2: XML attributes for temp-tables and ProDataSets
Attribute
Data type
Applies to
Description
NAMESPACE-URI 
(Readable and 
writeable) 
CHARACTER

temp-table temp-table buffer
ProDataSet

The namespace is a Uniform Resource Indicator (URI) used to uniquely identify attribute and element names and prevent collisions. Elements or attributes with the same name but a different namespace are considered different.

This attribute can also be set with the DEFINE TEMP-TABLE, DEFINE BUFFER, and DEFINE DATASET statements using the NAMESPACE-URI option.

NAMESPACE-PREFIX 
(Readable and 
writeable) 
CHARACTER 

temp-table temp-table buffer
ProDataSet

The prefix is used to identify elements which belong to the namespace associated with the NAMESPACE-URI attribute.

This attribute can also be set with the DEFINE TEMP-TABLE, DEFINE BUFFER, and DEFINE DATASET statements using the NAMESPACE-PREFIX option.

NESTED 
(Readable and 
writeable) 
LOGICAL 
Data-relation

A data-relation defines a parent-child relationship. Normally, data is represented in XML serially, one table followed by the next. Setting the NESTED attribute to TRUE directs Progress to nest the child rows of the relation within the parent row when written as XML. By default, the NESTED attribute is FALSE. The NESTED attribute also causes the XML Schema definitions for the related temp-tables to be nested.

This attribute can also be set with the DEFINE DATASET statement using the NESTED option on a DATA-RELATION specification.

XML-NODE-TYPE 
(Readable and 
writeable) 
CHARACTER 
Buffer-field

Specifies the XML representation for the field. It must be a CHARACTER expression evaluating to one of these values: ELEMENT, ATTRIBUTE, TEXT, HIDDEN.

  • If the XML-NODE-TYPE of a buffer-field is ELEMENT, the field is a child element of the temp-table row element in both the schema and instance data. This is the default.
  • If the XML-NODE-TYPE is ATTRIBUTE, the field will be represented as an attribute of the temp-table row element.
  • If XML-NODE-TYPE is TEXT, the field is a text element of the temp-table row.
  • Note: There can only be one TEXT field per table. If there is a TEXT field, there can be no ELEMENT fields, only ATTRIBUTE fields. Tables with text fields cannot be part of a nested DATA-RELATION.

  • If XML-NODE-TYPE is HIDDEN, the field is omitted from both the XML Schema and data during write operations.
  • Note: Buffer-fields that represent arrays must have XML-NODE-TYPE="ELEMENT" or XML-NODE-TYPE="HIDDEN".

XML-DATA-TYPE 
(Readable and 
writeable) 
CHARACTER 
Buffer-field

Specifies the XML Schema data type for the Progress buffer-field object. If the temp-table definition was created from an XML Schema, this attribute is the same as the type attribute from the XML Schema.

NAMESPACE-URI and NAMESPACE-PREFIX interact in a WRITE-XML method call in the following ways:


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095